<template>
  <a-card :bordered="false">
    <detail-list title="导师信息">
      <detail-list-item term="导师编号">{{ teacherInfo.gh }}&emsp;</detail-list-item>
      <detail-list-item term="姓名">{{ teacherInfo.xm }}&emsp;</detail-list-item>
      <detail-list-item term="性别">{{ teacherInfo.xbmc }}&emsp;</detail-list-item>
      <detail-list-item term="院系">{{ teacherInfo.ssyxmc }}&emsp;</detail-list-item>
      <detail-list-item term="专业">{{ teacherInfo.zdzymc }}&emsp;</detail-list-item>
      <detail-list-item term="身份证号">{{ teacherInfo.sfzjh }}&emsp;</detail-list-item>
      <detail-list-item term="出生日期">{{ teacherInfo.csrq && teacherInfo.csrq.format('YYYY-MM-DD') }}&emsp;</detail-list-item>
      <detail-list-item term="职称">{{ teacherInfo.zcmc }}&emsp;</detail-list-item>
      <detail-list-item term="手机号码">{{ teacherInfo.lxdh }}&emsp;</detail-list-item>
      <detail-list-item term="电子邮箱">{{ teacherInfo.dzxx }}&emsp;</detail-list-item>
      <detail-list-item term="固定电话">{{ teacherInfo.zzdh }}&emsp;</detail-list-item>
    </detail-list>
    <a-row>
      <span style="color:rgba(0,0,0,.85)">研究方向：</span>{{ teacherInfo.yjfx }}
    </a-row>
    <a-row style="text-align: center;">
      <a-button type="primary" @click="$router.back()">返回</a-button>
      <a-button type="primary" @click="exportPdf">打印</a-button>
    </a-row>
  </a-card>
</template>

<script>
import DetailList from '~/tool/DetailList'
const DetailListItem = DetailList.Item

export default {
  data () {
    return {
      teacherInfo: {}
    }
  },
  components: {
    DetailList,
    DetailListItem
  },
  created () {
    this.$api.overseas.teacherInfo(this.$db.get('USER').gh).then(res => {
      this.teacherInfo = res.data
    })
  },
  methods: {
    exportPdf () {
      let fileName = this.teacherInfo.xm + '_导师详细信息.pdf'
      this.$downloadPdf('/teacherClient/xn/dsPrint', {}, fileName)
    }
  }
}
</script>

<style>

</style>
